﻿using OA.Core;
using OA.Core.Helper;
using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model
{

    public class VApprovalItem 
    {
        
        public int ID { get; set; }

        public int ApprovalID { get; set; }

        public DateTime CreateDateTime { get; set; }


        /// <summary>
        /// 当前审批节点ID
        /// </summary>
        public int ApprovalNodeID { get; set; }

        /// <summary>
        /// 审批时间
        /// </summary>
        public DateTime? ApprovalTime { get; set; }

        /// <summary>
        /// 0：待审核 1：需沟通  2：会签  3:同意  4:不同意 5:已撤回 6:回退
        /// </summary>
        public int Status { get; set; }

        [NotMapped]
        public string StatusName { get { return MyEnum.GetEnumNameByValue(this.Status, typeof(ApprovalType)); } }


        /// <summary>
        /// 意见
        /// </summary>
        [MaxLength(200)]
        [Tag(TagEnum.Text, "required", "意见", 2, 200)]
        public string Explain { get; set; }

        /// <summary>
        /// 提交的数据
        /// </summary>
        public string Data { get; set; }

        /// <summary>
        /// 当前步骤
        /// </summary>
        public int Step { get; set; }

        /// <summary>
        /// 节点类型 1:普通类型 2:会签类型
        /// </summary>
        public int PointType { get; set; }

        /// <summary>
        /// 审批人
        /// </summary>
        [MaxLength(10)]
        public string EmpID { get; set; }

        [MaxLength(20)]
        public string EmpName { get; set; }

        public int PositionID { get; set; }


        public string PositionName { get; set; }

        public int DepartmentID { get; set; }


        public string DepartmentName { get; set; }


        /// <summary>
        /// 实际处理人
        /// </summary>
        [MaxLength(10)]
        public string RealEmpID { get; set; }

        [MaxLength(20)]
        public string RealEmpName { get; set; }


        public int RealPositionID { get; set; }


        public string RealPositionName { get; set; }

        public int RealDepartmentID { get; set; }


        public string RealDepartmentName { get; set; }


        [MaxLength(200)]
        public string IP { get; set; }

        /// <summary>
        /// 1:PC 2:小程序
        /// </summary>
        public int OS { get; set; }

        public string Pic { get; set; }

    }
}
